import { DeviceType, DualSenseInput } from "@babylonjs/core/DeviceInput/InputDevices/deviceEnums";
import { DeviceSource } from "@babylonjs/core/DeviceInput/InputDevices/deviceSource";
import { InputKeyStatus } from '../input-key-status';
import { DeviceInputKey } from "../device-information";


/**
 * @internal
 * 生成ps5手柄预设
 * @param device 设备源
 * @returns ps5手柄预设
 */
const DualSensePreset = (device: DeviceSource<DeviceType.DualSense>) => {
    return {
        Circle: new InputKeyStatus(DeviceInputKey.dualSenseCircle, DualSenseInput.Circle, device),
        Create: new InputKeyStatus(DeviceInputKey.dualSenseCreate, DualSenseInput.Create, device),
        Cross: new InputKeyStatus(DeviceInputKey.dualSenseCross, DualSenseInput.Cross, device),
        DPadDown: new InputKeyStatus(DeviceInputKey.dualSenseDPadDown, DualSenseInput.DPadDown, device),
        DPadLeft: new InputKeyStatus(DeviceInputKey.dualSenseDPadLeft, DualSenseInput.DPadLeft, device),
        DPadRight: new InputKeyStatus(DeviceInputKey.dualSenseDPadRight, DualSenseInput.DPadRight, device),
        DPadUp: new InputKeyStatus(DeviceInputKey.dualSenseDPadUp, DualSenseInput.DPadUp, device),
        Home: new InputKeyStatus(DeviceInputKey.dualSenseHome, DualSenseInput.Home, device),
        L1: new InputKeyStatus(DeviceInputKey.dualSenseL1, DualSenseInput.L1, device),
        L2: new InputKeyStatus(DeviceInputKey.dualSenseL2, DualSenseInput.L2, device),
        L3: new InputKeyStatus(DeviceInputKey.dualSenseL3, DualSenseInput.L3, device),
        LStickXAxis: new InputKeyStatus(DeviceInputKey.dualSenseLStickXAxis, DualSenseInput.LStickXAxis, device),
        LStickYAxis: new InputKeyStatus(DeviceInputKey.dualSenseLStickYAxis, DualSenseInput.LStickYAxis, device),
        Options: new InputKeyStatus(DeviceInputKey.dualSenseOptions, DualSenseInput.Options, device),
        R1: new InputKeyStatus(DeviceInputKey.dualSenseR1, DualSenseInput.R1, device),
        R2: new InputKeyStatus(DeviceInputKey.dualSenseR2, DualSenseInput.R2, device),
        R3: new InputKeyStatus(DeviceInputKey.dualSenseR3, DualSenseInput.R3, device),
        RStickXAxis: new InputKeyStatus(DeviceInputKey.dualSenseRStickXAxis, DualSenseInput.RStickXAxis, device),
        RStickYAxis: new InputKeyStatus(DeviceInputKey.dualSenseRStickYAxis, DualSenseInput.RStickYAxis, device),
        Square: new InputKeyStatus(DeviceInputKey.dualSenseSquare, DualSenseInput.Square, device),
        TouchPad: new InputKeyStatus(DeviceInputKey.dualSenseTouchPad, DualSenseInput.TouchPad, device),
        Triangle: new InputKeyStatus(DeviceInputKey.dualSenseTriangle, DualSenseInput.Triangle, device),
    };
};


export { DualSensePreset };